package com.springboot.demo.entity;

import com.springboot.demo.entity.validate.SceneIdGroup;
import com.springboot.demo.entity.validate.user.IdGroup;
import com.springboot.demo.utils.Constant;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author wubc683
 * @desc
 * @date 2021-10-13 17:33
 */
@Data
public class DiscreteAlarm {
    @ApiModelProperty(value = "报警id",required = true)
    @NotNull(message = "报警id不能为null",groups = IdGroup.class)
    private Long id;
    @ApiModelProperty(value = "报警序号",required = true)
    @NotNull(message = "报警序号不能为null")
    @Min(value = 0,message = "报警序号最小值为0")
    private Integer alarmNo;
    @ApiModelProperty(value = "场景id",required = true)
    @NotNull(message = "场景id不能为null",groups = SceneIdGroup.class)
    private Long sceneId;
    @ApiModelProperty(value = "报警文本,限制255字符",required = true)
    @NotBlank(message = "报警文本不能为null或者空")
    @Length(max = 255, message = "报警文本太长")
    private String alarmText;
    @ApiModelProperty(value = "触发变量序号",required = true)
    @NotNull(message = "触发变量序号不能为null")
    private Integer trigVarNo;
//    @ApiModelProperty(value = "触发变量名",required = true)
//    @NotBlank(message = "触发变量名不能为null或者空")
//    private String trigVarName;
    @ApiModelProperty(value = "触发位",required = true)
    @NotNull(message = "触发位不能为null")
    private Integer trigBit;
}